<template>
  <div class="header">
    vue2.0
    <a-dropdown style="position: absolute;right: 10px; top: calc(50% - 16px);">
      <a-menu slot="overlay" @click="handleMenuClick">
        <a-menu-item key="1"> 登出</a-menu-item>
      </a-menu>
      <a-button style="margin-left: 8px">
        <a-icon type="user" />
      </a-button>
    </a-dropdown>
  </div>
</template>

<script>
export default {
  name: "Header",
  data() {
    return {};
  },
  methods: {
    handleMenuClick(e) {
      switch (e.key) {
        case "1":
          this.$store.commit("LOGIN_OUT");
          window.location.reload();
          break;
      }
    }
  }
};
</script>

<style lang="less" scoped>
.header {
  height: 100%;
  width: 100%;
  background: white;
  font-size: 50px;
  line-height: 75px;
  text-align: center;
  position: relative;
}
</style>
